﻿@namespace BootstrapBlazor.Components
@inherits CollapseBase
@inject NavigationManager Navigator

<div @attributes="@AdditionalAttributes" class="@ClassString" @ref="CollapseElement">
    @foreach (var item in Items)
    {
        if (item.Items.Any())
        {
            <div class="card">
                <div class="card-header">
                    <div class="card-header-wrapper">
                        <MenuLink Item="@item" DisableNavigation="@DisableNavigation" class="@GetMenuItemLinkClassString(item)" data-toggle="collapse" aria-expanded="@GetExpandedString(item)" OnClick="@OnClickMenu" />
                        <i class="fa fa-angle-down"></i>
                    </div>
                </div>
                <div class="@GetMenuItemClassString(item)">
                    <div class="card-body has-leaf">
                        <SideMenu Items="@item.Items" DisableNavigation="@DisableNavigation" IsAccordion="@IsAccordion" OnClick="@OnClickMenu" />
                    </div>
                </div>
            </div>
        }
        else
        {
            <MenuLink Item="@item" DisableNavigation="@DisableNavigation" class="nav-link" OnClick="@OnClick" />
        }
    }
</div>
